import os

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.config import settings


class Verify:

    def verify_dir(self):
        return NotImplementedError

    def verify_path(self):
        return NotImplementedError



def init_middlewares(app: FastAPI):
    """初始化中间件"""
    app.add_middleware(
        CORSMiddleware,
        allow_origins=settings.CORS_ORIGINS,
        allow_credentials=settings.CORS_ALLOW_CREDENTIALS,
        allow_methods=settings.CORS_ALLOW_METHODS,
        allow_headers=settings.CORS_ALLOW_HEADERS,
    )
